package com.shujia.mvc2;

import com.shujia.mvc2.controller.UserController;

import java.io.InputStream;
import java.util.Scanner;

public class Test3ModifyPassword {
    public static void main(String[] args) {

        //1、输入用户名和密码

        //控制台输入流
        InputStream in = System.in;

        //包装流
        Scanner scanner = new Scanner(in);

        System.out.println("请输入用户名:");
        String username = scanner.next();

        System.out.println("请输入原密码:");
        String oldPassword = scanner.next();

        System.out.println("请输入新密码:");
        String newPassword = scanner.next();

        System.out.println("请确认新密码:");
        String nowPassword = scanner.next();

        System.out.println(username + "\t" + oldPassword + "\t" + newPassword + "\t" + nowPassword);

        //构建控制层对象
        UserController userController = new UserController();

        //调用修改密码的方法
        String modifyPassword = userController.modifyPassword(username, oldPassword, newPassword, nowPassword);

        //输出结果
        System.out.println(modifyPassword);

    }
}
